package com.wanaofu.model;

import java.io.Serializable;
import java.sql.Date;
import java.util.List;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

/**
 * @author jianguo.shi
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("SELL")
public class WarehouseDelivery extends AbstractWarehouseBatch implements Serializable {
	private static final long serialVersionUID = -7594189989590104462L;
	
	public Integer affectBalceAmount(Integer amt) {return 0 - Math.abs(amt);} ;
	
	public WarehouseDelivery() {}
	public WarehouseDelivery(String code,UserInfo user,Date opDate) {
		this.batchCode = code ;
		this.user = user;
		this.opDate = opDate;
	}
	public WarehouseDelivery(String code,UserInfo user,Date opDate,String remark,List<WarehouseBatchItem> items) {
		this(code,user,opDate) ;
		this.remark = remark;
		this.items = items ;
	}	
}
